<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/public/inc/tags.jsp"%>
<html>
<head>
    <jsp:include page="/public/inc/head.jsp"/>
</head>
<body>
<div id="header" class="navbar navbar-static-top" role="navigation">
    <jsp:include page="/public/inc/top.jsp"/>
</div>
<div class="container-fluid" style="margin-top:5px;margin-bottom:60px;">
    <div class="row">
        <jsp:include page="/public/inc/menu.jsp"/>
        <div class="col-xs-12 col-sm-10">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <div class="media">
                        <div class="media-body">
                            <span class="glyphicon glyphicon-list"></span>版本表管理
                        </div>
                        <div class="media-right">
                            <a href="/system/reversion/create" class="btn btn-primary">
                                <span class="glyphicon glyphicon-plus"></span> 版本添加
                            </a>
                        </div>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>编码</th>
                            <th>渠道编号</th>
                            <th>渠道名称</th>
                            <th>渠道版本号</th>
                            <th>是否强制更新版本</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            <c:forEach var="l" items="${list}" varStatus="status">
                                <tr>
                                    <td>
                                            ${status.index + 1}
                                    </td>
                                    <td>
                                            ${l.channeid}
                                    </td>

                                    <td>
                                            ${l.channelsubModel.channelsubname}
                                    </td>
                                    <td>
                                            ${l.versioncode}
                                    </td>

                                    <td>
                                        <c:choose>
                                            <c:when test="${l.forced_update eq 1 }">
                                                <span class="btn btn-primary btn-xs">是</span>
                                            </c:when>
                                            <c:otherwise>
                                                <span class="btn btn-danger btn-xs">否</span>
                                            </c:otherwise>
                                        </c:choose>
                                    </td>
                                    <td>
                                        <a class="btn btn-primary btn-xs"
                                           href="/system/reversion/edit?versionid=${l.versionid}">
                                            <span class="glyphicon glyphicon-pencil"></span> 修改
                                        </a>
                                        <a class="btn btn-danger btn-xs" onclick="del('${l.versionid}');">
                                            <span class="glyphicon glyphicon-trash"></span> 删除
                                        </a>
                                    </td>
                                </tr>
                            </c:forEach>
                        </tbody>
                    </table>
                </div>
                <div class="panel-footer">
                    <p:pagination url="/system/reversion/list" total="${listSize}"/>
                </div>
            </div>
        </div>
    </div>
</div>
<jsp:include page="/public/inc/bottom.jsp"/>
</body>
</html>
<script type="text/javascript">
    function del(versionid) {
        if (window.confirm("确认要删除？")) {
            window.location.href = "/system/reversion/delete?versionid=" + versionid;
        }
    }
</script>